<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2022/1/18
  Time: 14:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="common/head.jsp"%>
<html>
<head>
    <title>学生信息</title>
    <script>
        $(function(){
            $.ajax({
                url:"../user/findallstu",
                data:{},
                type:"post",
                dataType:"json",
                success:function(data){
                   var str = "";
                   for (var i in data){
                       // alert()
                       str +="<tr> <td>"+data[i].stuid+"</td>"
                            +"           <td>"+data[i].stuname+"</td>" +
                            "           <td>"+data[i].gender+"</td>" +
                            "            <td>"+data[i].clazz+"</td>"
                           +"<td>"+data[i].password+"</td>"+
                            "            <td>" +
                            "                <a href='../page/updatestudent?stuid="+data[i].stuid+"'>修改</a>" +
                            "                <a href='../user/deletestu?stuid="+data[i].stuid+"'>删除</a>" +
                            "            </td></tr>" ;
                   }

                    $("#table").append(str);
                }

            })

        })
    </script>
    <script src="../static/js/jquery-3.4.1.js"></script>
</head>
<style>
    table{
        margin-left: auto;
        margin-right: auto;
        margin-top: 100px;
    }
    td{
        width: 200px;
        height: 20px;
        text-align: center;

    }
</style>
<body>
<%--240,248,255--%>
    <table id="table" style="background-color: #f0f8ff;" border="1px solid red" cellspacing="0px"  >
        <caption><h2>学生信息</h2></caption>
        <tr>
            <td>学号：</td>
            <td>姓名：</td>
            <td>性别：</td>
            <td>班级：</td>
            <td>密码：</td>
            <td>操作：</td>
        </tr>
<%--        <tr>--%>
<%--            <td>111</td>--%>
<%--            <td>lisi</td>--%>
<%--            <td>男</td>--%>
<%--            <td>02</td>--%>
<%--            <td>123456</td>--%>
<%--            <td>--%>
<%--                <a href="">删除</a>--%>
<%--                <a href="">修改</a>--%>
<%--            </td>--%>
<%--        </tr>--%>
    </table>

</body>
<%@include file="common/foot.jsp" %>
</html>
